package com.spotmanger.project.modular.spottable.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spotmanger.project.modular.spottable.entity.SpottableHistoricalmineNewEntity;
import com.spotmanger.project.modular.spottable.mapper.SpottableHistoricalmineNewMapper;
import com.spotmanger.project.modular.spottable.service.SpottableHistoricalmineNewService;
import org.springframework.stereotype.Service;


@Service("spottableHistoricalmineNewService")
public class SpottableHistoricalmineNewServiceImpl extends ServiceImpl<SpottableHistoricalmineNewMapper, SpottableHistoricalmineNewEntity> implements SpottableHistoricalmineNewService {
    /**
     * 以TBBH为主,结合 LambdaQueryWrapper的模糊搜索方法。
     */
    @Override
    public LambdaQueryWrapper<SpottableHistoricalmineNewEntity> searchByTBBH(SpottableHistoricalmineNewEntity spottableHistoricalmine){
        LambdaQueryWrapper<SpottableHistoricalmineNewEntity> queryWrapper = Wrappers.lambdaQuery();
        if(spottableHistoricalmine.getTBBH()!=null){
            queryWrapper.like(SpottableHistoricalmineNewEntity::getTBBH,spottableHistoricalmine.getTBBH());
        }else {
            return queryWrapper;
        }
        return queryWrapper;
    }

}